import { S } from '../../s';
import { IPSDEUILogicLinkCond } from './ipsdeuilogic-link-cond';
import { IPSDEUILogicLinkGroupCond } from './ipsdeuilogic-link-group-cond';
import { PSModelObjectImpl } from '../../psmodel-object-impl';

export class PSDEUILogicLinkGroupCondImpl
  extends PSModelObjectImpl
  implements IPSDEUILogicLinkGroupCond
{
  get groupOP(): 'AND' | 'OR' {
    return this.M.groupOP;
  }

  get logicType(): 'GROUP' | 'SINGLE' {
    return this.M.logicType;
  }

  protected psdeuilogiclinkconds: IPSDEUILogicLinkCond[];
  getPSDEUILogicLinkConds(): IPSDEUILogicLinkCond[] | null {
    return (
      this.psdeuilogiclinkconds ||
      (this.psdeuilogiclinkconds = this.fillChildListModel(
        this.M.getPSDEUILogicLinkConds,
        S._29c,
      ) as IPSDEUILogicLinkCond[])
    );
  }

  findPSDEUILogicLinkCond(objKey: any): IPSDEUILogicLinkCond | null {
    return this.getPSModel5(
      S._29c,
      this.getPSDEUILogicLinkConds(),
      objKey,
    ) as IPSDEUILogicLinkCond;
  }

  get notMode(): boolean {
    return this.M.notMode != null ? this.M.notMode : false;
  }
  get cls(): string {
    return 'PSDEUILogicLinkGroupCondImpl';
  }
  instanceof(cls: string): boolean {
    if (cls == S._1e5) return true;
    return super.instanceof(cls);
  }
}
